package com.wisnews.service.sec.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wisnews.mapper.sec.RoleMapper;
import com.wisnews.pojo.sec.entity.Role;
import com.wisnews.service.sec.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统角色 服务实现类
 * </p>
 *
 * @author yuyd
 * @since 2020-12-20
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public String getJurisdiction4RoleId(String operatorRole) {

        return roleMapper.getJurisdiction(operatorRole);
    }

    @Override
    public IPage<Role> getRoleInfoPage(IPage page, Role req) {
        Wrapper wrapper = Wrappers.lambdaQuery();

        IPage roleInfoPage = roleMapper.getRoleInfoPage(page, wrapper);

        return roleInfoPage;
    }
}
